package com.crud.application;

import com.crud.domain.HiveDataAccess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class HiveService {

    @Autowired
    private HiveDataAccess hiveDataAccess;

    // 查询数据
    public List<Map<String, Object>> getHiveData(String sql) {
        return hiveDataAccess.queryData(sql);
    }

    // 插入数据
    public int insertHiveData(String sql) {
        return hiveDataAccess.insertData(sql);
    }

    // 更新数据
    public int updateHiveData(String sql) {
        return hiveDataAccess.updateData(sql);
    }

    // 删除数据
    public int deleteHiveData(String sql) {
        return hiveDataAccess.deleteData(sql);
    }
}
